#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define LL long long

const int N = 2e5 + 5;
int n, M;LL k;
LL a[N], b[N];
LL sm[N];

bool check(LL o, LL d) {
    int p = std::upper_bound(b + 1, b + n + 1, o + d) - b;
    int t = n - p + 1;
    if (t >= M) return 0;
    LL S = (sm[p - (M - t)] - sm[p]);
    if (b[p - (M - t)] <= o && o <= b[p - 1]) {
        S -= o;
        S += b[p - (M - t) - 1];
    }
    return (o + d + 1) * (M - t) - S > k - d;
}

int main() {
    scanf("%d%d%lld", &n, &M, &k);
    if (M == n) {
        FOR(i, 1, n) printf("0 ");
        puts("");
        return 0;
    }
    FOR(i, 1, n) scanf("%lld", a + i), b[i] = a[i], k -= a[i];
    std::sort(b + 1, b + n + 1);ROF(i, n, 1) sm[i] = sm[i + 1] + b[i];
    FOR(i, 1, n) {
        LL l = 0, r = k, ans = -1;
        while (l < r) {
            LL mid = (l + r) >> 1;
            if (check(a[i], mid)) r = mid;
            else l = mid + 1;
        }
        if (check(a[i], l)) cout << l << ' ';
        else cout << -1 << ' ';
    }
    return 0;
}
